package JDBC;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

/*
* 更改数据*/
public class Text04 {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        Class.forName("oracle.jdbc.driver.OracleDriver");
        Connection connection = DriverManager.getConnection(
                "jdbc:oracle:thin:@localhost:1521:orcl",
                "kz",
                "root"
        );
        Statement statement = connection.createStatement();
        String sql="Update dept set loc ='山东淄博' where deptno=60";
        statement.executeUpdate(sql);
        statement.close();
        connection.close();
    }
}
